Object.defineProperty(exports, "__esModule", {
    value: true
});

exports.MapPoints = exports.Polyline = exports.Marker = exports.PolylineList = exports.MarkerList = undefined;

var _mapConfig = require("./mapConfig.js");

var _mapDrawer = require("./mapDrawer.js");

var _util = require("./util_2.js");

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}

_mapDrawer.Marker.MarkerType = _mapConfig.MarkerType;

_mapDrawer.Polyline.PolylineType = _mapConfig.PolylineType;

var mapDrawer = {
    addBusStationPolyline: function addBusStationPolyline(polylineList, stationPoints) {
        polylineList.removePolylines("busAndStation");
        for (var i = 0, len = stationPoints.length; i < len - 1; i++) {
            polylineList.addPolyline(new _mapDrawer.Polyline([ {
                latitude: stationPoints[i].lat,
                longitude: stationPoints[i].lng
            }, {
                latitude: stationPoints[i + 1].lat,
                longitude: stationPoints[i + 1].lng
            } ], "busAndStation"));
        }
        return polylineList;
    },
    drawArea: function drawArea(polylineList, areaList) {
        polylineList.removePolylines("area");
        areaList.forEach(function(area) {
            var points = area.areaList.map(function(item) {
                return {
                    latitude: item.latitude,
                    longitude: item.longitude
                };
            });
            points.push(points[0]);
            polylineList.addPolyline(new _mapDrawer.Polyline(points, "area"));
        });
        return polylineList;
    },
    /**
   * 地图上画圆圈
   * @param {Array[circle]} circles 
   * @param {Object} item 
   * @return {Array[circles]} 
   */
    drawCircles: function drawCircles(circles, item, index) {
        // circles = circles.filter(item => item._id !== 'call_circle');
        index = index % 4;
        var radiusNums = [ 0, 90, 200, 360 ];
        var fillColorArr = [ "#0EC0CFF", "#0EC0CA15", "#0EC0CA15", "#0EC0CA10" ];
        circles.push({
            latitude: item.lat,
            longitude: item.lng,
            color: "#fff",
            fillColor: fillColorArr[index],
            radius: radiusNums[index],
            strokeWidth: 0
        });
        return circles;
    },
//     /**
//    * 在首页添加出租车的位置markers
//    * @param {Array[marker]} 
//    * @param {Array[taxiItem]} taxiList 出租车列表
//    * @return {Array[marker]} markers
//    */
//     drawTaxiIcon: function drawTaxiIcon(markerList, taxiList) {
//         //markers = markers.filter(item => item._id !== "taxi");
//         markerList.removeMarkers("taxi");
//         taxiList.forEach(function(item, key) {
//             var marker = new _mapDrawer.Marker(item, "taxi").setProp("rotate", _util2.default.formatAngle(item.angle));
//             if (item.callout) {
//                 marker.setCallout({
//                     content: item.callout,
//                     borderRadius: 10,
//                     padding: 10,
//                     textAlign: "center",
//                     fontSize: 14,
//                     display: "ALWAYS"
//                 });
//             }
//             markerList.addMarker(marker);
//         });
//         return markerList;
//     }
};

exports.default = mapDrawer;

exports.MarkerList = _mapDrawer.MarkerList;

exports.PolylineList = _mapDrawer.PolylineList;

exports.Marker = _mapDrawer.Marker;

exports.Polyline = _mapDrawer.Polyline;

exports.MapPoints = _mapDrawer.MapPoints;